package com.ruoyi.service.impl;

import com.ruoyi.mapper.VerRepliesMapper;
import com.ruoyi.order.domain.VerReplies;
import com.ruoyi.service.VerRepliesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class VerRepliesServiceImpl implements VerRepliesService {
    @Autowired
    private VerRepliesMapper verRepliesMapper;

    @Override
    public List<VerReplies> selectRepliesByReviewId(Long reviewId) {
        return verRepliesMapper.selectRepliesByReviewId( reviewId);
    }

    @Override
    public int insertReply(VerReplies reply) {
        if (reply.getCreatedTime() == null) {
            reply.setCreatedTime(new Date());
        }
        return verRepliesMapper.insertReply( reply);
    }

    @Override
    public VerReplies selectReplyById(Long id) {
        return verRepliesMapper.selectReplyById( id);
    }
}
